import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class TooltipPage extends StatelessWidget {
  const TooltipPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("TooltipPage"),
      ),
      body: ListView(
        scrollDirection: Axis.vertical,
        padding: const EdgeInsets.all(10),
        children: const [
          Tooltip(
            message: 'I am a Tooltip',
            child: Text("Hover over the text to show a tooltip"),
          ),
          SizedBox(
            width: 10,
            height: 20,
          ),
          Tooltip(
            richMessage: TextSpan(
                text: "I am a rich tooltip",
                style: TextStyle(color: Colors.red),
                children: <InlineSpan>[
                  TextSpan(
                    text: 'I am another span of this rich tooltip',
                    style: TextStyle(fontWeight: FontWeight.bold),
                  )
                ]),
            child: Text('Tap this text and hold to show a tooltip'),
          )
        ],
      ),
    );
  }
}
